/* --- Variables & Reset --- */
:root {
    /* DARK MODE (Default) */
    --bg-color: #0a192f;
    --bg-light: #112240;
    --bg-navbar: rgba(10, 25, 47, 0.85);
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --accent: #64ffda; /* Teal/Cyan */
    --line-color: #233554;
    
    --font-main: 'Calibre', 'Inter', 'San Francisco', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
}

/* LIGHT MODE (triggered by JS) */
body.light-mode {
    --bg-color: #ffffff;
    --bg-light: #f0f2f5;
    --bg-navbar: rgba(255, 255, 255, 0.85);
    --text-primary: #0a192f;
    --text-secondary: #334155;
    --accent: #0f766e; /* Darker Teal for visibility on white */
    --line-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden; /* Prevents horizontal scroll from animations */
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* --- 1. INTRO OVERLAY (The "Hi" Screen) --- */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 9999; /* On top of everything */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

/* Class to hide the overlay */
#intro-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-text {
    font-size: 6rem;
    color: var(--accent);
    font-weight: bold;
    font-family: var(--font-mono);
    animation: pulse 2s infinite;
}

.intro-sub {
    margin-top: 20px;
    font-size: 1.2rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- 2. FLOATING BACKGROUND SHAPES --- */
#background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind everything */
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px); /* Creates the glowing orb effect */
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #64ffda;
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: #112240; /* Dark blue orb */
    bottom: 10%;
    right: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #bd34fe; /* Purple accent */
    top: 40%;
    left: 30%;
    opacity: 0.2;
    animation-duration: 25s;
}

/* Light mode adjustments for shapes */
body.light-mode .shape-1 { background: #0f766e; opacity: 0.2; }
body.light-mode .shape-2 { background: #cbd5e1; opacity: 0.5; }
body.light-mode .shape-3 { background: #a855f7; opacity: 0.2; }

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50px, 100px) rotate(20deg); }
}

/* --- 3. SCROLL ANIMATION CLASSES --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px); /* Start slightly lower */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* --- Layout Utilities --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 25px;
}

.section {
    padding: 100px 0;
}

.bg-alt {
    background-color: var(--bg-light);
}

/* --- Navbar --- */
.navbar {
    height: 80px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--bg-navbar);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: bold;
    font-family: var(--font-mono);
}

.logo span {
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.nav-links a:hover {
    color: var(--accent);
}

/* --- Resume Button Styling --- */
.resume-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--line-color);
    background-color: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-main);
    transition: all 0.2s ease;
}

.resume-btn:hover {
    background-color: rgba(100, 255, 218, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

.resume-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Theme Toggle Button */
#theme-toggle {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

#theme-toggle:hover {
    background: rgba(100, 255, 218, 0.1);
}

/* --- HERO SECTION (With Blob) --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
}

/* 2-Column Layout for Hero */
.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Text Side (Left) */
.hero-text {
    flex: 1;
    max-width: 600px;
    text-align: left;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}



/* Blob Animation Wrapper */
.img-wrapper {
    width: 350px;
    height: 350px;
    position: relative;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; /* Blob shape */
    overflow: hidden;
    animation: morph 8s ease-in-out infinite; /* Moving shape animation */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background-color: var(--accent);
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes morph {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

.hero h1 {
    font-size: 4rem;
    color: var(--text-primary);
    line-height: 1.1;
}

.greeting {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1rem;
    margin-bottom: 20px;
    display: block;
}

.role {
    font-size: 3rem;
    color: var(--text-secondary);
    line-height: 1.1;
    margin-bottom: 20px;
}

.bio {
    max-width: 500px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* --- Buttons --- */
.btn {
    color: var(--accent);
    background-color: transparent;
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 1.25rem 1.75rem;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    cursor: pointer;
    margin-top: 20px;
    display: inline-block;
}

.btn:hover {
    background-color: rgba(100, 255, 218, 0.1);
}

/* --- Social Icons --- */
.social-links {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* --- Section Titles --- */
.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.section-title::after {
    content: "";
    display: block;
    width: 200px;
    height: 1px;
    background-color: var(--line-color);
    margin-left: 20px;
}

/* --- ABOUT SECTION (Image Left, Text Right) --- */

.about-container {
    display: flex;
    align-items: center; /* Vertically centers them */
    gap: 50px;           /* Space between image and text */
}

/* 1. Image Side (Left) */
.about-image {
    flex: 0 0 100px;     /* Fixed width for image container */
    max-width: 100px;
    position: relative;
}

/* Wrapper for the Frame Effect */
.image-wrapper-rect {
    position: relative;
    width: 100%;
    border-radius: 4px;
    background-color: var(--accent);
    transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.image-wrapper-rect img {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    mix-blend-mode: multiply;
    filter: grayscale(100%) contrast(1);
    transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* The Frame Border behind the image */
.image-wrapper-rect::after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 4px;
    top: 20px;
    left: -20px; /* Moves border to the left for this layout */
    z-index: -1;
    transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Hover Effects */
.image-wrapper-rect:hover {
    background-color: transparent;
}
.image-wrapper-rect:hover img {
    filter: none;
    mix-blend-mode: normal;
    transform: translate(5px, -5px);
}
.image-wrapper-rect:hover::after {
    top: 10px;
    left: -10px;
}

/* 2. Text Side (Right) */
.about-text {
    flex: 1; /* Takes up remaining space */
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* --- Skills Grid --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.skill-item {
    background: var(--bg-light);
    color: var(--accent);
    padding: 15px;
    text-align: center;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.skill-item:hover {
    transform: translateY(-5px);
}

/* --- Projects --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.project-card {
    background-color: var(--bg-light);
    padding: 2rem 1.75rem;
    border-radius: 4px;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.1);
}

.project-card:hover {
    transform: translateY(-7px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-header .fa-folder {
    color: var(--accent);
    font-size: 40px;
}

.card-links a {
    color: var(--text-primary);
    margin-left: 15px;
    font-size: 1.2rem;
}

.card-links a:hover {
    color: var(--accent);
}

.project-card h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* --- Contact Section --- */
.contact-section {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 100px;
}

.subtitle {
    color: var(--accent);
    font-family: var(--font-mono);
    margin-bottom: 20px;
}

.contact-text {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 20px;
}

/* --- Responsive (Mobile) --- */
@media (max-width: 768px) {
    /* Hide desktop nav links */
    .nav-links { display: none; }
    
    /* Adjust text sizes */
    .hero h1 { font-size: 2.5rem; }
    .role { font-size: 1.5rem; }
    .section { padding: 60px 0; }
    .intro-text { font-size: 4rem; }

    /* Hero Section Mobile */
    .hero-container {
        flex-direction: column-reverse; /* Image on top, text below */
        text-align: center;
        gap: 30px;
    }

    .hero-text {
        text-align: center;
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .img-wrapper {
        width: 250px;
        height: 250px;
    }

    /* About Section Mobile */
    .about-container {
        flex-direction: column;
        align-items: center;
    }

    .about-image {
        margin-bottom: 40px;
        width: 70%;
    }
}